﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CMS.BLL;

public partial class Controls_Common_ctrFooter : System.Web.UI.UserControl
{
    private int nCurrentLang = Support.GetCurrentLanguage();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.InitData();
        }
    }

    private void InitData()
    {
        StaticPages objStatic = new StaticPages();
        Company objCompany = new Company();
        DataTable dtbCompany = new DataTable();
        dtbCompany = objCompany.Search();
        switch (nCurrentLang)
        { case 1:
                lblAddress.Text = "Địa chỉ: " +  ConvertData.ConvertToString(dtbCompany.Rows[0]["Address1"]);
                break;
            case 2:
                lblAddress.Text = "Address: " + ConvertData.ConvertToString(dtbCompany.Rows[0]["Address2"]);
                break;
            case 3:
                lblAddress.Text = "Address: " + ConvertData.ConvertToString(dtbCompany.Rows[0]["Address3"]);
                break;
        }

       
        lblCopyright.Text = ConvertData.ConvertToString(dtbCompany.Rows[0]["Copyright"]);
        lblEmail .Text = "Email: " + ConvertData.ConvertToString(dtbCompany.Rows[0]["Email"]);
        lblFax .Text = "Fax: " + ConvertData.ConvertToString(dtbCompany.Rows[0]["Fax"]);
        lblTel .Text = "Tel: " + ConvertData.ConvertToString(dtbCompany.Rows[0]["Tel"]);
        lblWebsite .Text = "Website: " + ConvertData.ConvertToString(dtbCompany.Rows[0]["Website"]);



        lnkAboutUs.Text = MultipleLanguage.ABOUTUS[nCurrentLang - 1];
        lnkAboutUs.NavigateUrl = Config.ROOT + Pages.FrontEnds.STATIC_PAGE + "?" + Config.PAGE_ID + "=" +  objStatic.GetIDbyPageCode("about-us");

        lnkContactUs.Text = MultipleLanguage.CONTACT[nCurrentLang - 1];
        lnkContactUs.NavigateUrl = Config.ROOT + Pages.FrontEnds.CONTACTUS;

        lnkHome.Text = MultipleLanguage.HOME[nCurrentLang - 1];
        lnkHome.NavigateUrl = Config.ROOT + Pages.FrontEnds.HOME;

        lnkNews.Text = MultipleLanguage.NEWS[nCurrentLang - 1];
        lnkNews.NavigateUrl = Config.ROOT + Pages.FrontEnds.NEWS_BYCAT;

        lnkPrice.Text = MultipleLanguage.QUOTA[nCurrentLang - 1];
        lnkPrice.NavigateUrl = Config.ROOT + Pages.FrontEnds.BASKET_DETAIL;

        lnkProduct.Text = MultipleLanguage.PRODUCT[nCurrentLang - 1];
        lnkProduct.NavigateUrl = Config.ROOT + Pages.FrontEnds.PRODUCT_CATEGORY;

        lnkService.Text = MultipleLanguage.SERVICE[nCurrentLang - 1];
        lnkService.NavigateUrl = Config.ROOT + Pages.FrontEnds.STATIC_PAGE + "?" + Config.PAGE_ID + "=" + objStatic.GetIDbyPageCode("dịch-vụ");
    }
}
